package com.tuniu.agents.common.service;

import lombok.Builder;
import lombok.Getter;

import java.util.List;

public interface AntispamService {

    /**
     * User input check
     *
     * @return
     */
    public String antispamCheck(String conversationId, String userMessage, String responseId);

    @Builder
    public record AntispamRequest(
            String tokenId,
            String systemCode,
            String text,
            ExpandParams expandParams,
            boolean isDisrupt,
            Integer filterType) {

    }

    @Builder
    public record ExpandParams(String channel) {

    }

    public record AntispamResponse(
            @Getter
            boolean success,
            @Getter
            String errorCode,
            @Getter
            String errorStack,
            @Getter
            String msg,
            @Getter
            FilterResult data) {
    }

    public record FilterResult(
            @Getter
            boolean passed, Integer respType, String filterId, Integer filterSystemType, List<TextResult> textResult, List<ImageResult> imageResult) {
    }

    public record TextResult(
            String text, String reason, String groupCode, String groupDesc, Integer levelCode, String levelDesc, Integer filterSource) {

    }

    public record ImageResult(
            String imageUrl, String reason, Integer filterSource) {
    }
}
